<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>确认付款</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="__INDEX__/css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" href="__INDEX__/css/style.css" />
		<link rel="stylesheet" href="__INDEX__/css/iconfont.css" />
		<link rel="stylesheet" href="__INDEX__/css/mall.css" />
	</head>

	<body>
		<div class="mui-content qrfuk_content">
			<div class="fuk_conbox">
				<div class="fuk_ctop">
					<div class="fuk_ctimg"><img style="width: 60px;height: 60px;border-radius:5px;" id='store_thum' src="{$agent_info['logo']}"></div>
					<div class="fuk_spnam">{$agent_info['agent_name']}</div>
				</div>
				<form method="post" action="{:url('index/pay/check_money1')}" id='myform'>
					<div class="fuk_center">
						<div>付款金额</div>
						<div class="fuk_pribox">
							<label>¥</label>
							<input name='origin_price' id='origin_price' style="text-align: left;" onkeyup="clearNoNum(this)" type="text"></input>
						</div>
					</div>
					<input type="hidden" name="user_id" value="{$pay_info['user_id']}" />
					<input type="hidden" name="agent_id" value="{$pay_info['agent_id']}" />
					<input type="hidden" name="store_id" value="{$pay_info['store_id']}" />
					<input type="hidden" name="clerk_id" value="{$pay_info['clerk_id']}" />
					<input type="hidden" name="pay_type" value="{$pay_info['pay_type']}" />
					<button type="button" class="qrfuk_btn" id='qrfuk_btn'>确认付款</button>
				</form>
			</div>
		</div>
	</body>
</html>
{include file="public/footer" /}
<script>
	$('#qrfuk_btn').click(function(){
		
		var origin_price = $('#origin_price').val();
		
		if(origin_price.trim()==""){
			layer.msg('请输入付款金额');
			return ;
		}
		$.ajax({
         	type:"post",
            url:"{:url('index/pay/check_money1')}",
            data: $('#myform').serialize(),//表单数据
            success:function(data){
            	if(data.code == 200){
            		location.href = data.url;
            	}else{
            		layer.msg(data.msg);
            	}
                
            },error:function(data){
            	var a = data;
            }
    	});
	});
	
	//只能数字和小数点
	function clearNoNum(obj) {
		obj.value = obj.value.replace(/[^\d.]/g, ""); //清除“数字”和“.”以外的字符
		obj.value = obj.value.replace(/^\./g, ""); //验证第一个字符是数字而不是.
		obj.value = obj.value.replace(/\.{2,}/g, "."); //只保留第一个. 清除多余的.
		obj.value = obj.value.replace(".", "$#$").replace(/\./g, "").replace("$#$", ".");
	}
	
	
</script>
	